home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / wildcat / wc_bink.zip / BINK.BAT < prev    next >
DOS Batch File  |  1992-12-17  |  19KB  |  409 lines

  1. @echo off
  2. REM /******************************************************************\
  3. REM /* Ok, here we go. First, I set the environment variables that    *\
  4. REM /* wildcat needs for execution. Assumptions are as follows:       *\
  5. REM /* Wildcat directory is C:\WC30 and Binkley dir is D:\BINKLEY     *\
  6. REM /******************************************************************\
  7. set WCNODEID=1
  8. set WCPORTID=1
  9. set WCMDM=NONE
  10. set WCNODELIST=D:\BINKLEY\NODE\
  11. REM /******************************************************************\
  12. REM /* That being done, I start up BNU as my fossil driver. Frankly,  *\
  13. REM /* you could use anything. I just prefer BNU as it has proven     *\
  14. REM /* very stable. I use BNU170.                                     *\
  15. REM /******************************************************************\
  16. BNU /F+ /R:2048
  17. :START
  18. REM
  19. REM  The following environment variables aid in deciding what process is
  20. REM  presently executing. If the LIVE variable has a value, the user is calling the
  21. REM  BBS. Since my batch file runs both the mailer and Wildcat, I use
  22. REM  environment variables to indicate if the bat file is in a "mailer"
  23. REM  mode, or in a "BBS caller is online" mode. If BINK.BAT is started when
  24. REM  the variable LIVE is equal to 2, then a user has called, hit escape,
  25. REM  and been processed by BBSBATCH.BAT/SPAWNBBS.BAT (this whole setup
  26. REM  assumes the BBS Batch parameter specified in the Binkley/Milque.cfg file.
  27. REM
  28.  if 2==%live% goto WILDCAT
  29. REM This checks to see if new nodediff files have been received.  If the
  30. REM nodediff.* exists in the inbound files area they are moved to the Bink
  31. REM node area to be compiled.
  32. REM
  33. if exist d:\binkley\files\nodelist\nodediff.*  goto NLIST
  34. if exist d:\binkley\files\nodelist\nodelist.*  goto NLIST
  35. REM
  36. REM  By this point, we know a caller isn't online, so we clear out all our
  37. REM  Environment variables, and initialize the mailer
  38. REM
  39. REM
  40.  SET LIVE=
  41.  set baud=
  42.  set minleft=
  43.  D:
  44.  cd\binkley
  45.  cls
  46. REM
  47. REM  Here we get to the "meat" of things. Since I run BinkleyTerm 2.56 beta
  48. REM here, I need to load a video fossil if I want to get a color screen.
  49. REM I use VFOS_DV, as I use DesqView, but VFOS_IBM works as well in a non-
  50. REM DV environment. Frankly, I've used VFOS_DV in a non-Desqview environment
  51. REM as well, so I don't bother switching. The Video fossil must always
  52. REM be loaded last, after the communications fossil (BNU in my case). I
  53. REM always unload it if I'm dropping to Wildcat, or not kicking binkley back
  54. REM up immediately, in order to save memory.
  55. REM
  56. vfos_dv
  57. REM
  58. REM  Here, I start up the mailer, BT.EXE.
  59. REM
  60. bt
  61. REM /******************************************************************\
  62. REM /* Now it gets nasty.... here's how we do things. Control in the  *\
  63. REM /* BAT file is via ERRORLEVELS. Binkley returns errorlevels       *\
  64. REM /* as follows:                                                    *\
  65. REM /* For a caller pressing Escape, the errorlevel is the linespeed  *\
  66. REM /* divided by 100, such as 96 for 9600, 24 for 2400, 12 for 1200, *\
  67. REM /* etc, except when the line speed exceeds 9600 (ie, if you       *\
  68. REM /* run with a locked DTE rate as I do, and you configure Binkley  *\
  69. REM /* with the DTE locked, it will always exit with the errorlevel   *\
  70. REM /* for the DTE rate, and will pass to the BBS both the connect    *\
  71. REM /* rate and the DTE rate. I run locked at 19200, so the errorlevel*\
  72. REM /* for a "human" caller is always 192. Above 19200, the error-    *\
  73. REM /* levels change... consult the Binkley docs for the errorlevel   *\
  74. REM /* returned for 38,400 and 57,600 DTE rate connects.)             *\
  75. REM /******************************************************************\
  76. REM /* Other errorlevels are set by the BinkleyTerm event file,       *\
  77. REM /* such as errorlevels for receipt of mail. Errorlevels evenly    *\
  78. REM /* divisible by 100 are function key presses (ie, errorlevel      *\
  79. REM /* 100 means F10 was pressed and errorlevel 50 means F5 was       *\
  80. REM /* pressed.                                                       *\
  81. REM /******************************************************************\
  82.   if errorlevel 255 goto exit-err
  83.   if errorlevel 254 goto exit-nl
  84.   if errorlevel 192 goto LDBBS
  85.   if errorlevel 144 goto LDBBS
  86.   if errorlevel 100 goto Lococat
  87.   if errorlevel  96 goto LDBBS
  88.   if errorlevel  90 goto packmail
  89.   if errorlevel  70 goto bonkit
  90.   if errorlevel  60 goto Msg_read
  91.   if errorlevel  50 goto Act_view
  92.   if errorlevel  48 goto LDBBS
  93.   if errorlevel  46 goto nmh_tts
  94.   if errorlevel  45 goto nmh_mwf
  95.   if errorlevel  40 goto nmh_in
  96.   if errorlevel  24 goto LDBBS
  97.   if errorlevel  20 goto Mail_in
  98.   if errorlevel  12 goto LDBBS
  99.   if errorlevel  10 goto maint
  100.   if errorlevel   3 goto LDBBS
  101.   if errorlevel   1 goto Exit
  102.   if errorlevel   0 goto Exit
  103.  
  104. goto Exit
  105.  
  106. REM /******************************************************************\
  107. REM /* We come here if a caller is online.                            *\
  108. REM /*                                                                *\
  109. REM /*  Here, BBSBATCH.BAT is executed, which is a file Binkley       *\
  110. REM /* creates itself, containing the callers' speed, time before     *\
  111. REM /* the next mailer event, etc. BBSBATCH.BAT will attempt to run   *\
  112. REM /* SPAWNBBS.BAT, which YOU MUST PROVIDE. I use SPAWNBBS.BAT to    *\
  113. REM /* set environment variables (like the afformentioned %live%      *\
  114. REM /* variable among others, and then it re-calls the BINK.BAT file  *\
  115. REM /* (This avoids my having to run a batch file for Wildcat and     *\
  116. REM /* another for Binkley). Here's my SPAWNBBS.BAT (Since Wildcat    *\
  117. REM /* doesn't like a connect speed of 12000, I do a little  "fancy   *\
  118. REM /* dance" to reset it to 9600. I also make sure the /ARQ message  *\
  119. REM /* that my modem returns for error-correcting conditions is also  *\
  120. REM /* recognized, as Wildcat needs to be told in a different way.)   *\
  121. REM /*                                                                *\
  122. REM /*    if .%5==. SET EC=                                           *\
  123. REM /*    if .%5==./Arq SET EC=MNP                                    *\
  124. REM /*    if .%5==./ARQ SET EC=MNP                                    *\
  125. REM /*    if .%baud%==.12000 goto fixbaud                             *\
  126. REM /*    bink.bat                                                    *\
  127. REM /*    goto endit                                                  *\
  128. REM /*    :fixbaud                                                    *\
  129. REM /*    set baud=9600                                               *\
  130. REM /*    bink.bat                                                    *\
  131. REM /*    :endit                                                      *\
  132. REM /*    set live=2                                                  *\
  133. REM /*    set dte=%1                                                  *\
  134. REM /*    set baud=%2                                                 *\
  135. REM /*    set minleft=%4                                              *\
  136. REM /*    bink.bat                                                    *\
  137. REM /*                                                                *\
  138. REM /* That's all it needs....                                        *\
  139. REM /*                                                                *\
  140. REM /******************************************************************\
  141. :LDBBS
  142. VFOS_DEL
  143. REM SET vfosstat=
  144. BBSBATCH.BAT
  145.  
  146. REM /******************************************************************\
  147. REM /* I use Golded for my external netmail reader. You don't have to *\
  148. REM /* use it, as Wildcat supports Netmail, but I find it easier not  *\
  149. REM /* having to log onto the BBS to read netmail.                    *\
  150. REM /*                                                                *\
  151. REM /*                                                                *\
  152. REM /* I use SQUISH to handle netmail routing, hence the "squish      *\
  153. REM /* squash" line... it's explained further on below.               *\
  154. REM /******************************************************************\
  155. :msg_read
  156. VFOS_DEL
  157. golded
  158. if errorlevel 2 goto pakmsg
  159. goto start
  160. :pakmsg
  161. squish squash -salways
  162. goto start
  163.  
  164. :bonkit
  165. REM /******************************************************************\
  166. REM /* I use BONK as my outbound manager. It's the greatest thing     *\
  167. REM /* since sliced bread in my opinion. You can obtain it here as    *\
  168. REM /* BONK_174.ARJ                                                   *\
  169. REM /******************************************************************\
  170. VFOS_DEL
  171. bonk
  172. goto start
  173.  
  174. :WILDCAT
  175. REM /******************************************************************\
  176. REM /* Here's where Wildcat is actually executed. This is essentially *\
  177. REM /* a CAT.BAT imbedded in the BINK.BAT file. Nothing special here, *\
  178. REM /* except to clear and use some environment variables set by the  *\
  179. REM /* SPAWNBBS.BAT file.                                             *\
  180. REM /******************************************************************\
  181.  del bbsbatch.bat
  182.  c:
  183.  cd\wc30
  184. :doit
  185.  Wildcat /B %baud%%ec% %minleft%
  186. :endcat
  187.  SET LIVE=
  188. goto start
  189.  
  190. :mail_in
  191. REM /******************************************************************\
  192. REM /* Mail_in is the routine that calls Wildmail to toss newly       *\
  193. REM /* incoming mail. It is called by errorlevel 20 exit from BT,     *\
  194. REM /* because I code an E2=20 in the Binkley.evt even description    *\
  195. REM /* file. There are other ways to do this as well.. consult the    *\
  196. REM /* docs for Binkley. C:\WC30\MAILCHK.BAT is the batch file that   *\
  197. REM /* runs Wildmail. I externalized it so I could manually run a     *\
  198. REM /* scan/toss myself. The CALL parameter is important, due to      *\
  199. REM /* batch programming rules.. we want control to come back to      *\
  200. REM /* THIS batch file when MAILCHK.BAT is done. If you forget to     *\
  201. REM /* use the CALL parameter when running one batch file from        *\
  202. REM /* within another, the calling batch file terminates.             *\
  203. REM /******************************************************************\
  204. VFOS_DEL
  205. AT H1
  206. call c:\wc30\mailchk.bat
  207. goto start
  208.  
  209.  
  210. REM /******************************************************************\
  211. REM /* nmh_in, nmh_mwf, and nmh_tts are special schedules for SQUISH's*\
  212. REM /* routing function to handle special situations. I run nmh_mwf on*\
  213. REM /* Monday, Wednesday, and Friday. You can gues when nmh_tts runs  *\
  214. REM /* (grin). This is controlled by the Binkley/Milque.evt file      *\
  215. REM /* as to when each is executed by specifying E1=errorlevel.       *\
  216. REM /* nmh_in is run when mail comes in during a network mail hour,   *\
  217. REM /* and ensures nothing is tossed until all mail for the mail      *\
  218. REM /* hour has been received. That way I don't spend half my mail    *\
  219. REM /* hour tossing echomail, instead of placing mail calls.          *\
  220. REM /******************************************************************\
  221. :nmh_in
  222. VFOS_DEL
  223. call c:\wc30\mailchk.bat NMH
  224. goto start
  225.  
  226. :nmh_mwf
  227. VFOS_DEL
  228. call c:\wc30\mailchk.bat POLLMWF
  229. D:\
  230. cd \binkley
  231. REM /************************************************************************\
  232. REM /* PLEASE is a small utility to issue certain commands like SEND, GET   *\
  233. REM /* and POLL from a command line. POLL commands could also be done       *\
  234. REM /* via the SQUISH program as elements of a schedule block. It's a       *\
  235. REM /* matter of preference.                                                *\
  236. REM /* PLEASE is available here as PLZ22.LZH and PLEZ210.LZH (get both).    *\
  237. REM /* I use PLEASE to poll my network hosts daily for mail.                *\
  238. REM /************************************************************************\
  239. REM
  240. PLEASE POLL 100:902/0 CRASH
  241. PLEASE POLL 1:143/110 CRASH
  242. PLEASE POLL 77:1/0 CRASH
  243. goto start
  244.  
  245. :nmh_tts
  246. VFOS_DEL
  247. REM set vfosstat=
  248. WAIT! 5
  249. call c:\wc30\mailchk.bat POLLTTS
  250. D:\
  251. cd \binkley
  252. PLEASE POLL 100:902/0 CRASH
  253. PLEASE POLL 1:143/110 CRASH
  254. PLEASE POLL 77:1/0 CRASH
  255. goto start
  256.  
  257. :packmail
  258. REM /************************************************************************\
  259. REM /* "Packing" mail, in a Binkley environment, means doing nother more    *\
  260. REM /* than compressing netmail into archived packets, and routing them     *\
  261. REM /* to the proper hubs, and also providing a means of controlling the    *\
  262. REM /* "flavor" of echomail bindles, allowing you to HOLD, CRASH, or        *\
  263. REM /* otherwise tailor mail bundles. Other mailers like FrontDoor and      *\
  264. REM /* D'Bridge have this routing/control feature internalized, but         *\
  265. REM /* Binkley does not. I use SQUISH to perform this function. Other       *\
  266. REM /* acceptable (and smaller) packages are QMail, OMMM, and BNP.          *\
  267. REM /************************************************************************\
  268. REM
  269. VFOS_DEL
  270. squish squash -SALWAYS
  271. goto start
  272.  
  273. :act_view
  274. REM /************************************************************************\
  275. REM /* I have assigned F5 from the binkley screen to run the ActView        *\
  276. REM /* activity log analyzer for Wildcat. It is invoked from this section.  *\
  277. REM /************************************************************************\
  278. REM
  279. VFOS_DEL
  280. C:\
  281. CD \WC30
  282. actview
  283. D:\
  284. CD \Binkley
  285. goto start
  286.  
  287. :NLIST
  288. REM /************************************************************************\
  289. REM /* Here's where things get hairy. A new Nodelist or Nodediff file for   *\
  290. REM /* FIDOnet has been received. I have my mail tossing batch file copy    *\
  291. REM /* all NODELIST.* and NODEDIFF.* files to a "holding pen", and if the   *\
  292. REM /* pen is found to have anything in it when BINK.BAT is started, this   *\
  293. REM /* routine is run. It simply compiles a new nodelist using QNODE.       *\
  294. REM /* Other utilites like XLAXNODE will also compile a version 7 nodelist, *\
  295. REM /* but QNODE, while slower, is free. QNODE174.ARJ on this BBS           *\
  296. REM /************************************************************************\
  297. REM
  298. VFOS_DEL
  299.  d:\
  300.  cd \binkley\node
  301.  copy D:\binkley\files\nodelist\*.*
  302. REM /************************************************************************\
  303. REM /* QDIFF applies nodediff files to the master nodelist file from last   *\
  304. REM /* week.                                                                *\
  305. REM /************************************************************************\
  306.  QDIF NODELIST!NODEDIFF
  307. REM /************************************************************************\
  308. REM /* QNODE performs the compilation of the nodelist Binkley needs to      *\
  309. REM /* operate.                                                             *\
  310. REM /************************************************************************\
  311.  QNODE
  312.  if errorlevel 0 goto ok
  313.  goto exit-nl
  314. ok:
  315. REM /************************************************************************\
  316. REM /* QIDX creates cross-reference indices.                                *\
  317. REM /************************************************************************\
  318.  QIDX /N
  319.  QIDX /S
  320.  cd \binkley
  321. REM /************************************************************************\
  322. REM /* Since I use the GOLDED editor, it needs its' own special nodelist    *\
  323. REM /* compilation... yet more disk space wasted....                        *\
  324. REM /************************************************************************\
  325.  goldnode -F golded.cfg
  326.  cd \binkley\node
  327. REM /************************************************************************\
  328. REM /* finally, since WILDCAT needs yet ANOTHER special nodelist compilation*\
  329. REM /* format, I have to run WILDNODE now.. be careful! Wildnode does NOT   *\
  330. REM /* delete old compiled nodelists, and do not use a version of Wildnode  *\
  331. REM /* older than 1.50. Trust me.                                           *\
  332. REM /************************************************************************\
  333. wildnode
  334. REM /************************************************************************\
  335. REM /* Clean up the file in the holding pen...                              *\
  336. REM /************************************************************************\
  337. del d:\binkley\files\nodelist\nodediff.*
  338. del d:\binkley\files\nodelist\nodelist.*
  339.  cd \binkley
  340.  goto start
  341.  
  342. :LOCOCAT
  343. REM /******************************************************************\
  344. REM /* LOCOCAT is for loggin onto Wildcat Locally by hitting F10 in   *\
  345. REM /* the Binkley mailer screen.                                     *\
  346. REM /******************************************************************\
  347. VFOS_DEL
  348.  set minleft=
  349.  set baud=local
  350.  c:\
  351.  cd \wc30
  352.  goto doit
  353.  
  354. :maint
  355. REM /******************************************************************\
  356. REM /* maint is my routine that calls a maintenance batch file called *\
  357. REM /* C:\WC30\MONGO.BAT to do door maintenance, and other nightly    *\
  358. REM /* trivia. I reboot the PC as a last step of MONGO.BAT to start   *\
  359. REM /* fresh by issuing a BNU /B command to the fossil. Consequently, *\
  360. REM /* the routine should never get past MONGO.BAT                    *\
  361. REM /******************************************************************\
  362. VFOS_DEL
  363. BNU /U
  364. c:
  365. cd \wc30
  366. mongo.bat
  367. BNU /F+ /R:2048
  368. goto start
  369.  
  370. :BC
  371. VFOS_DEL
  372. REM vfosstat=
  373.  echo ...................................................................
  374.  echo ...................................................................
  375.  echo ...................... BAD CONNECTION  RECYCLE......................
  376.  echo ...................................................................
  377.  echo ...................................................................
  378.  echo ...................................................................
  379.  
  380.  set live=
  381.  set baud=
  382.  goto start
  383.  
  384. :Exit
  385. VFOS_DEL
  386. REM set vfosstat=
  387. BNU /U
  388. goto getout
  389.  
  390. :exit-nl
  391. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  392. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  393. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  394. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  395. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  396. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  397. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  398. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  399. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  400. Echo THE NODELIST IS CORRUPTED...........SHUTTING DOWN
  401. :exit-err
  402. VFOS_DEL
  403. REM set vfosstat=
  404. BNU /U
  405. goto getout
  406.  
  407.  
  408. :getout
  409.